<div class="portlet">
  <div class="portlet-header">
    <h1><%=t ".title"%></h1>
  </div>

  <div class="portlet-content">
    <% form_tag profiles_path, :method => 'get' do %>
      <table style="border:0px">
        <tr>
          <th> <%= label_tag t('activerecord.attributes.profile.contact') %> </th>
          <th> <%= text_field_tag :search_contact, params[:search_contact] %> </th>
          <th> <%= submit_tag t('btn_search'), :name => nil %> </th>
        </tr>
      </table>
    <% end %>

    <div class="line-label">
      <%= page_entries_info(@profiles) %>
    </div>

    <% if @profiles.size > 0 %>
      <% paginated_section(@profiles, options_will_paginate) do %>
        <table>
          <thead>
            <tr>
              <th><%=t('activerecord.attributes.profile.contact')%></th>
              <th><%=t('activerecord.attributes.profile.reference')%></th>
              <th></th>
              <th><%=t('activerecord.attributes.profile.excluded')%></th>
              <!--th colspan="3"><%#= t('title_actions') %></th-->
            </tr>
          </thead>

          <tbody>
            <% @profiles.each do |profile| %>
              <tr>
                <td><%=h " #{profile.contact.first_name} #{profile.contact.last_name}"%></td>
                <% if profile.reference.nil? %>
                  <td></td>
                <% else %>
                  <% if profile.reference_type == 'Thematic' %>
                    <td><%=t profile.reference_type %></td>
                    <td><%=h profile.reference.name_to_local_language%></td>                    
                  <% end %>
                  <% if profile.reference_type == 'Country' %>
                    <td><%=t profile.reference_type %></td>
                    <td><%=h profile.reference.name%></td>                    
                  <% end %>
                  <% if profile.reference_type == 'Descriptor' %>
                    <td><%=t profile.reference_type %></td>
                    <td><%=h profile.reference.description%></td>                    
                  <% end %>
                <% end %>
                <td><%=h get_boolean_description(profile.excluded) %></td>

                <!--
                <td class="action"><%#= link_to t('btn_show'), profile %></td>
                <td class="action"><%#= link_to t('btn_edit'), edit_profile_path(profile) %></td>
                <td class="action"><%#= link_to t('btn_destroy'), profile, :confirm => t('msg_sure_destroy?'), :method => :delete %></td>
                -->
              </tr>
            <% end %>
          </tbody>
        </table>
      <% end %>
    <% end %>

    <!--
    <div class="line-links">
      <%#= link_to t('profiles.index.btn_new_profile'), new_profile_path %>
    </div>
    -->
  </div>

  <div class="portlet-footer">
  </div>
</div>